import java.io.File;
import java.io.IOException;
import jxl.*;
import jxl.read.biff.BiffException;

public class XLSHandler {
	private File xlsFile;
	private Workbook wb;
	private boolean success;
	
	public XLSHandler(String pathToXLSFile) {
		xlsFile = new File(pathToXLSFile);
		
		try {
			wb = Workbook.getWorkbook(xlsFile);
			success = true;
		} catch (BiffException be) {
			System.out.println("Error opening workbook (BiffException): " + be.getMessage());
			success = false;
		} catch (IOException ioe) {
			System.out.println("Error opening workbook (IOException): " + ioe.getMessage());
			success = false;
		}
	}
	
	public Workbook getWorkbook() {
		if(success)
			return wb;
		else
			return null;
	}
}
